var nowa;
var animateAUTO = {
	_setinterval:null,
	_setintervalD:null,
	tempUH:0,
	tempUD:0,
	_up:function(id){
		var obj = document.getElementById(id);
		this._setinterval = setInterval(function(){animateAUTO._cutH(obj);},2);
	},
	_down:function(id){
		var obj = document.getElementById(id);
		this._setintervalD = setInterval(function(){animateAUTO._cutHD(obj);},2);
	},
	_cutH:function(obj){
		var ht = obj.clientHeight;
		this.tempUH += 5;
		ht -= 5;
		if(this.tempUH < 80){
			obj.style.height = ht + 'px';
		}else{
			clearTimeout(this._setinterval);
		}
	},
	_cutHD:function(obj){
		var ht = obj.clientHeight;
		this.tempUD += 5;
		ht -= 5;
		if(this.tempUD < 80){
			obj.style.height = ht + 'px';
		}else{
			clearTimeout(this._setintervalD);
		}
	},
	clearTime:function(timeout){
		clearTimeout(timeout);
	},
	fadeObj : null,
	fadeInTimer : null,
	fadeIn : function(id){//淡入效果
//		var bodyH  = document.documentElement.scrollHeight ,
//			  bodyW = document.documentElement.scrollWidth ;
//			  bodyH =  document.documentElement.clientHeight > bodyH?document.documentElement.clientHeight:bodyH;
//		var bg = document.createElement('div');
//			  bg.style.display	 = 'block';
//			  bg.style.position = 'absolute';
//			  bg.style.width    = bodyW + 'px';
//			  bg.style.height 	 = bodyH + 'px';
//			  bg.style.left     	 = 0;
//			  bg.style.top		 = 0;
//			  bg.style.background = '#939393';
//			  bg.style.opacity  = 0;
//		document.documentElement.appendChild(bg);
		this.fadeObj = document.getElementById(id);
		
		this.fadeInTimer = setInterval(function(){
			animateAUTO.animate('in',100);
		},20);
	},
	fadeOut : function(){
		this.fadeInTimer = setInterval(function(){
			animateAUTO.animate('out',100);
		},20);
	},
	animate : function(t,opc){
		var opcity = Math.ceil(this.fadeObj.style.opacity*100);
		if(t == 'in'){
			if(opcity <= opc){
				 this.fadeObj.style.opacity = eval((opcity + 5)/100);
			}else{
				clearTimeout(this.fadeInTimer );
			}
		}else{
			if(opcity > 0){
				 this.fadeObj.style.opacity = eval((opcity - 5)/100);
			}else{
				clearTimeout(this.fadeInTimer );
				this.fadeObj.parentNode.removeChild(this.fadeObj);
				this.fadeObj = null;					
			}
		}
	}
};
function op(type){
	animateAUTO._up('main_top');
	animateAUTO._down('main_foot');

}

animateAUTO.fadeIn("main_box");

setTimeout(function(){mainShow();},1000);

function mainShow(){
	document.getElementById("ctitle").innerHTML = '';
	document.getElementById("main_foot").innerHTML = '';
	setTimeout(function(){
		animateAUTO.fadeIn("logincontainer");
	},100);
}



